<extend name="Public/base"/>
<block name="body">
<!-- 区域价格 -->
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>
  <form action="{:U('position')}" method="post" class="form-horizontal">
    <div class="order-item-table mb-10">
      <table class="dynamic-table">
        <thead>
          <tr>
            <th>指定地区</th>
            <th width="110">区域名称</th>
            <th width="110">基础价格比例</th>
            <th width="110">操作</th>
          </tr>
        </thead>
        <tbody class="J_zoneList">
        <volist name="data" id="vo">
            <tr id="n{$key+1}">
                <td class="area-group">
                    <input type="hidden" class="ids" name="ids[{$key+1}]" value="{$vo['areas']}" />
                    <span>{$vo.areas_name}<if condition="$vo['is_exist'] eq 0"><front style="color:red">【与可售区域冲突】</front></if></span>
                </td>
                <td>
                    <input type="text" class="input-mini" value="{$vo['zone_name']|default='1'}" name="kd[{$key+1}][zone]">
                </td>
                <td>
                    <input type="text" class="input-mini" value="{$vo['rate']|default='100'}" name="kd[{$key+1}][zone_rate]">%
                </td>
                <td>
                    <a href="javascript:;" data-text='{$vo["id"]}' data-url='{:U("Item/position_del")}' class="J_delZone text-danger">[删除]</a>
                    <a class="J_transport" href="javascript:;" data-list="n{$key+1}">[选择地区]</a>
                    <input name="areas[{$key+1}]" type="hidden" value="{$vo['areas']}|||{$vo['areas_name']}" />
                    <input name="id[{$key+1}]" type="hidden" value="{$vo['id']}" />
                </td>
            </tr>
        </volist>
        </tbody>
      </table>
    </div>
    <div class="form-item">
      <div class="controls"><a class="J_setZone" href="javascript:;">增加指定区域 +</a></div>
    </div>
    <div class="form-item">
      <p style='color:red'>友情提示：区域价格功能开启后，需先对价格区域进行分区,分区数量不宜过多</p>
    </div>
    <div class="form-item button-item">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <a href="javascript:history.go(-1);" class="btn btn-return">返 回</a> </div>
  </form>
</block>
<block name="script"> 
  <script type="text/javascript">
    $(function(){
      //导航高亮
      highlight_subnav("{:U('position')}");
      //运费模板
      Core.setValue('price_type', '{$data.type|default = 1}');
      Core.setValue('express_start', "{$data['extend']['0']['express_start']|default = 1}");
      Core.setValue('express_postage', "{$data['extend']['0']['express_postage']|default = 8}");
      Core.setValue('express_plus', "{$data['extend']['0']['express_plus']|default = 1}");
      Core.setValue('express_postageplus', "{$data['extend']['0']['express_postageplus']|default = 12}");
      (function(){
        position.init("{:U('Transport/Myzone')}");
      })();
    });
  </script> 
</block>
